package com.lkd.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lkd.entity.User;
import com.lkd.report.CollectNodeList;
import com.lkd.report.NodeCollect;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UserMapper extends BaseMapper<User>{

    /**
     * 登录
     */
    @Select("select * from tb_user where login_name = #{loginName} and password = #{password}")
    User login(String loginName, String password);

    List<User> list(String userName);

    @Select("select * from tb_user where id = #{id}")
    User getById(Integer id);


    Boolean insertUser(User user);


    Boolean updateUser(User user);

    @Delete("delete from tb_user where id = #{id}")
    int deleteByUserId(Long id);

    Integer nodeCount();
}
